<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>新建话题微博单元 - 新建内容输出单元 - 组件管理</title>
<link href="<?php echo W_BASE_URL;?>css/admin.css" rel="stylesheet" type="text/css" />
<script src="<?php echo W_BASE_URL;?>js/jquery.js"></script>
<script src="<?php echo W_BASE_URL;?>js/xwb-all.js"></script>
<script src="<?php echo W_BASE_URL;?>js/wbshow.js"></script>
</head>
<script>
function changTabStyle(id) {
	if (!id) {
		return false;
	}
	var array_style = new Array('base_style_area', 'ext_style_area');
	var k;
	$('#'+id).css('display', '');
	$('#li_'+id).removeClass('current');
	$('#li_'+id).addClass('current');
	for (k in array_style) {
		if (id == array_style[k]) {
			continue;
		}
		$('#'+array_style[k]).css('display', 'none');
		$('#li_'+array_style[k]).removeClass('current');
	}
}
</script>
<body>
<div class="main-wrap">
<div class="path"><span class="path-icon"></span>当前位置：<span>组件管理</span> &gt; <span>输出单元设置</span> &gt; <span><?php if (isset($id)):?>内容输出单元列表<?php else:?>新建内容输出单元<?php endif;?></span> &gt; <span><?php if (!isset($id) && $type == 1):?>微博秀单元<?php elseif (!isset($id) && $type == 2):?>用户列表单元<?php elseif (!isset($id) && $type == 3):?>话题微博单元<?php else:?>设置<?php endif;?></span></div>
    <div class="set-wrap">
		<h4 class="main-title"><?php if (isset($id) && $type == 1):?>微博秀单元: <?php echo isset($row['unit_name']) ? F('escape', $row['unit_name']) : '';?><?php elseif (isset($id) && $type == 2):?>用户列表单元: <?php echo isset($row['unit_name']) ? F('escape', $row['unit_name']) : '';?><?php elseif (isset($id) && $type == 3):?>话题微博单元: <?php echo isset($row['unit_name']) ? F('escape', $row['unit_name']) : '';?><?php elseif ($type == 1):?>新建微博秀单元<?php elseif ($type == 2):?>新建用户列表单元<?php elseif ($type == 3):?>新建话题微博单元<?php endif;?></h4>
		<div class="set-area-int">
			<div class="panel">
            	<div class="panel-l">
				<form id="styleForm" action="<?php echo URL('mgr/content_unit.save');?>" method="post">
                    <div class="panel-set">
            			<div class="skinlist-menu">
							<ul class="skin-menu1">
                            	<li id="li_base_style_area" class="current"><a href="javascript:void(0)" onclick="changTabStyle('base_style_area')">基础设置</a></li>
								<li id="li_ext_style_area"><a href="javascript:void(0)" onclick="changTabStyle('ext_style_area')">样式设置</a></li>
							</ul>
						</div>
                        <div class="style-con">
                        	<div id="base_style_area" class="exp-style">
                            	<div class="con-wrap">
                                	<h4>输出单元名称：</h4>
    								<input name="unit_name" class="input-box unit-w" type="text" value="<?php echo isset($row['unit_name']) ? F('escape', $row['unit_name']) : '';?>" />
                                </div>
                                <div class="con-wrap">
                                	<h4>设置尺寸：</h4>
									<span class="con-edge">宽<input name="width" class="input-box size-w" type="text" vrel="_f|dimention" value="<?php echo isset($row['width']) && $row['width'] > 0 ? $row['width'] : 350;?>" id="iptAutoWidth" <?php if (isset($row['width']) && $row['width'] > 0):?><?php else:?>disabled="disabled"<?php endif;?> />px</span>
									<span class="con-edge">高<input name="height" id="viewHeight" class="input-box size-w" vrel="_f|dimention" type="text" value="<?php echo isset($row['height']) ? $row['height'] : 550;?>" />px</span>
                                	<p>宽度:190-1024px，高度:75-800px</p>
									<span class="con-edge"><input id="chkAutoWidth" name="adaptive" class="chk" type="checkbox" value="1" <?php if (isset($row['width']) && $row['width'] > 0):?><?php else:?>checked="checked"<?php endif;?> />宽度自动适应</span>
                                </div>
                                <div class="con-wrap reset-bg">
    								<?php if ($type == 1):?>
                                	<h4>设置微博秀用户(昵称)：</h4>
    								<input name="target" class="input-box unit-w" type="text" value="<?php echo isset($row['target']) ? F('escape', $row['target']) : '';?>" />
    								<?php elseif ($type == 3):?>
                                	<h4>设置话题：</h4>
    								<input name="target" class="input-box unit-w" type="text" value="<?php echo isset($row['target']) ? F('escape', $row['target']) : '';?>" />
    								<?php else:?>
                                	<h4>设置列表：</h4>
    								<select name="target">
    								<?php foreach ($re_list as $item):?>
    									<option value="<?php echo $item['group_id'];?>" <?php if (isset($row['target']) && ($row['target'] == $item['group_id'])):?>selected="selected"<?php endif;?>><?php echo $item['group_name'];?></option>
    								<?php endforeach;?>
    								</select>
    								<?php endif;?>
    
                                </div>
                        	</div>
                        	<div id="ext_style_area" class="exp-style" style="display:none">
                        		<div class="con-wrap">
                            		<h4>模块设置</h4>
                                	<span class="con-edge">
									<input name="show_title" id="mod1" class="chk" type="checkbox" <?php if (isset($row['show_title']) && empty($row['show_title'])):?><?php else:?>checked="checked"<?php endif;?> value="1" />
                                        <label for="mod1">显示标题栏</label>
                                    </span>
                                	<span class="con-edge">
                                    	<input name="show_border" id="mod2" class="chk" type="checkbox" <?php if (isset($row['show_border']) && empty($row['show_border'])):?><?php else:?>checked="checked"<?php endif;?> value="1" />
                                    	<label for="mod2">显示边框</label>
                                    </span><br />
                                	<span class="con-edge">
                                    	<input name="show_logo" id="mod3" class="chk" type="checkbox" <?php if (isset($row['show_logo']) && empty($row['show_logo'])):?><?php else:?>checked="checked"<?php endif;?> value="1" />
                                    	<label for="mod3">显示LOGO栏</label>
                                    </span>
                            	</div>
                            	<div class="con-wrap reset-bg">
                            		<h4>外观方案</h4>
                                	<div class="color-slt" id="skinPanel">
                                		<a href="" class="on"><span class="color01"><em></em></span></a>
                                    	<a href=""><span class="color02"><em></em></span></a>
                                    	<a href=""><span class="color03"><em></em></span></a>
                                    	<a href=""><span class="color04"><em></em></span></a>
                                    	<a href=""><span class="color05"><em></em></span></a>
                                    	<a href=""><span class="color06"><em></em></span></a>
                                    	<a href=""><span class="color07"><em></em></span></a>
                                    	<a href=""><span class="color08"><em></em></span></a>
                                    	<a href=""><span class="color09"><em></em></span></a>
                                    	<a href=""><span class="color10"><em></em></span></a>
                                	</div>
                            	</div>
                        	</div>
                        </div>
						<input type="hidden" id="skinType" name="skin" value="<?php echo isset($row['skin']) ? $row['skin'] : 1;?>" />
						<input type="hidden" name="type" value="<?php echo $type;?>" />
						<input type="hidden" name="id" value="<?php echo isset($id) ? $id : 0;?>" />
                	</div>
                    <div class="exp-code">
                        <p class="get-code">设置完成,获得嵌入代码:</p>
						<textarea name="" id="output" class="input-box code" cols="" rows=""><?php echo $iframe_code;?></textarea>
                    </div>
                    <div class="button">
                    	<input name="" type="submit" value="保存设置" />
                    	<a href="#" class="copy-code" id="getCode">获取代码</a>
                    </div>
                    </form>
                </div>
                <div class="panel-r">
				<h3>效果预览：</h3>
				<iframe class="exp-main" id="export" name="export" width="<?php echo isset($row['width']) && $row['width'] > 0 ? $row['width'] : '100%';?>" height="<?php echo isset($row['height']) ? $row['height'] : 550;?>" frameborder="0" src="<?php echo $iframe_url;?>"  scrolling="no"></iframe>
                </div>
            </div>
        </div>
    </div>
</div>
<script> gPreviewUrl = '<?php echo $preview_url;?>';</script>
</body>
</html>
